{include file="admin/header.htm"}
<div id="header">
    <div class="logo"><a href="{$smarty.const.ADMIN_NAME}"><img src="{geturl('/static/images/logo.jpg')}" width="220" height="58" border="0"/></a></div>
    
    <p id="info_bar">
        用户名：<strong class="font_arial white" id="username">-</strong>，
        角色：<span id="groupname">-</span>
        | <a href="{$smarty.const.ADMIN_NAME}" class="white">后台首页</a>
        | <a href="{geturl('/')}" target="_blank" class="white">网站首页</a>
        | <a href="{$smarty.const.ADMIN_NAME}?m=admin&c=login&a=logout" class="white">退出登录</a>
    </p>
    
    <div id="menu">
        <ul>
            {$i=0}
            {foreach $menus as $menu}
            <li><a id="topmenu_{$menu.id}" name="topmenu" href="javascript:showTopMenu({$menu.id})" class="menu{if $i eq 0} selected{/if}"><span>{$menu.menu_name}</span></a></li>
            {$i=$i+1}
            {/foreach}
        </ul>
    </div>
</div>

<div id="middle">
    <h4><span id="menu_name">我的面板</span></h4>
</div>

<div id="admin_left">
    <div id="tree_box" class="p_r" style="left:6px;" >
        <div id="tree" class="tree p_a" style="top:34px;margin-top:5px;overflow:auto;overflow-x:hidden;">{$submenu_html}</div>
    </div>
</div>

<div id="admin_right">
    <iframe name="right" id="right" frameborder="0" src="{$smarty.const.ADMIN_NAME}?m=admin&c=index&a=main" style="top:0px;left:0px;height:100%;width:100%;overflow-y:scroll;background-color:#ffffff;"></iframe>
</div>
{include file="admin/footer.htm"}
<script type="text/javascript">
function showMenu(pid) {
    var id = '#container_' + pid;
    var flag = '#flag_' + pid;
    $(id).css('display') == 'none' ? $(id).show() : $(id).hide();
    $(id).css('display') == 'none' ? $(flag).addClass('expandable-hitarea') : $(flag).removeClass('expandable-hitarea');
}

function showTopMenu(pid) {
    var topmenuid = 'topmenu_' + pid;
    var id = 'container_' + pid;
    $("ul[name='container']").each(function(index, obj) {
        obj.id == id ? $(obj).show() : $(obj).hide();
    });
    
    $("a[name='topmenu']").each(function(index, obj) {
        obj.id == topmenuid ? $(obj).addClass('selected') : $(obj).removeClass('selected');
    });
}

$('#username').html(decodeURI(getcookie('a_username')));
$('#groupname').html(decodeURI(getcookie('a_groupname')));
</script>
